package com.example.monitoringsystem.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.monitoringsystem.bean.User;
import com.example.monitoringsystem.mapper.UserMapper;
import com.example.monitoringsystem.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public User findUserByAccount(String account) {
        QueryWrapper<User> wrapper = new QueryWrapper<User>();
        wrapper.eq("account", account);
        User user = userMapper.selectOne(wrapper);
        return user;
    }

    @Override
    public User findDoctorById(int doctorId) {
        QueryWrapper<User> wrapper = new QueryWrapper<User>();
        wrapper.eq("id", doctorId);
        User user = userMapper.selectOne(wrapper);
        return user;
    }


}

